/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "APKFile")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "APKFile.findAll", query = "SELECT a FROM APKFile a"),
    @NamedQuery(name = "APKFile.findByApkFileID", query = "SELECT a FROM APKFile a WHERE a.apkFileID = :apkFileID"),
    @NamedQuery(name = "APKFile.findByApkVersionName", query = "SELECT a FROM APKFile a WHERE a.apkVersionName = :apkVersionName"),
    @NamedQuery(name = "APKFile.findByApkFileName", query = "SELECT a FROM APKFile a WHERE a.apkFileName = :apkFileName"),
    @NamedQuery(name = "APKFile.findByApkVersionID", query = "SELECT a FROM APKFile a WHERE a.apkVersionID = :apkVersionID")})
public class APKFile implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "apkFileID")
    private Integer apkFileID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "apkVersionName")
    private String apkVersionName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "apkFileName")
    private String apkFileName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "apkVersionID")
    private int apkVersionID;
    @Lob
    @Column(name = "apkFile")
    private byte[] apkFile;

    public APKFile() {
    }

    public APKFile(Integer apkFileID) {
        this.apkFileID = apkFileID;
    }

    public APKFile(Integer apkFileID, String apkVersionName, String apkFileName, int apkVersionID) {
        this.apkFileID = apkFileID;
        this.apkVersionName = apkVersionName;
        this.apkFileName = apkFileName;
        this.apkVersionID = apkVersionID;
    }

    public Integer getApkFileID() {
        return apkFileID;
    }

    public void setApkFileID(Integer apkFileID) {
        this.apkFileID = apkFileID;
    }

    public String getApkVersionName() {
        return apkVersionName;
    }

    public void setApkVersionName(String apkVersionName) {
        this.apkVersionName = apkVersionName;
    }

    public String getApkFileName() {
        return apkFileName;
    }

    public void setApkFileName(String apkFileName) {
        this.apkFileName = apkFileName;
    }

    public int getApkVersionID() {
        return apkVersionID;
    }

    public void setApkVersionID(int apkVersionID) {
        this.apkVersionID = apkVersionID;
    }

    public byte[] getApkFile() {
        return apkFile;
    }

    public void setApkFile(byte[] apkFile) {
        this.apkFile = apkFile;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (apkFileID != null ? apkFileID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof APKFile)) {
            return false;
        }
        APKFile other = (APKFile) object;
        if ((this.apkFileID == null && other.apkFileID != null) || (this.apkFileID != null && !this.apkFileID.equals(other.apkFileID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.APKFile[ apkFileID=" + apkFileID + " ]";
    }
    
}
